<!DOCTYPE html>
<html>
	<head>
		<title>制证</title>
		<meta http-equiv="Pragma" CONTENT="no-cache">
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<meta name="renderer" content="webkit">
		<!-- <link href="${cxt !}/sb/themes/demo.css" rel="stylesheet" type="text/css" /> -->
		<link href="${cxt !}/ddc/css/lsdj.css" rel="stylesheet" type="text/css" />
		<%include("/common/include.html"){}%>
		<script src="http://echarts.baidu.com/build/dist/echarts.js"></script>	
		<script src="${cxt !}/sb/js/binShopService/binShopService.js" type="text/javascript" charset="utf-8"></script>
		<style>
			body{
				width: 500px;
				margin: 0 auto;
			}
			table td{
				border-bottom: 1px dashed #333;
				padding-left: 10px;
				height: 30px;
			}
		</style>
	</head>
	<body >
	<form id="info_form">
	<!--startprint-->
		<div style="width: 500px; text-align: center;margin-top: 10px;">中华人民共和国机动车行驶证</div>
		<table width="500">
			<input type="hidden"  name="vehicle.ids"  value="${vehicle.ids}"/>
	   <tr align="left">
          <td width="25%">号牌号码</td>
          <td>${vehicle.HPHM}</td>
          <td>车辆类型</td>
          <td>电动车</td>
        </tr>
        <tr align="left">
          <td>所有人</td>
          <td colspan="3">${vehicle.SYR!}</td>
        </tr>
        <tr align="left">
          <td>住址</td>
          <td colspan="3">${vehicle.ZSXZQH!} ${vehicle.ZSXXDZ!}</td>
        </tr>
        <tr align="left">
          <td>使用性质</td>
          <td>非营运</td>
          <td>品牌型号</td>
          <td>${vehicle.CLPP1!}</td>
        </tr>
        <tr align="left">
          <td>注册日期</td>
          <td>${vehicle.DJRQ}</td>
          <td>发证日期</td>
          <td>2018-01-17</td>
        </tr>
        <tr align="left">
          <td>号牌号码</td>
          <td>${vehicle.HPHM}</td>
          <td>档案编号</td>
          <td>${vehicle.LSH}</td>
        </tr>
        <tr align="left">
          <td>核定载人数</td>
          <td>1人</td>
          <td>总质量</td>
          <td>${vehicle.ZZL!}kg</td>
        </tr>
        <tr align="left">
          <td>备注</td>
          <td colspan="3">${vehicle.BZ!}  </td>
        </tr>
        <tr align="left">
          <td>检查记录</td>
          <td colspan="3">检验有效期至2020年01月</td>
        </tr>
		</table>
		<!--endprint-->
		</form>
	</body>
</html>


	<script type="text/javascript">
	//@ sourceURL=mmm.js
				var $form = $('#info_form');
				var submitNow = function($dialog, $grid, $tree, $pjq) {
					var url = "${cxt!}/zz/savezz";
					$.post(url, sy.serializeObject($form), function(result) {
						if (result == true) {
							doPrint(); 
							parent.refresh();
							$.slideMsg("更新成功！", $pjq);
							$dialog.dialog('destroy');
						} else {
							$.alert($pjq, result.msg);
						}
					}, 'json');
				};
				var submitForm = function($dialog, $grid, $tree, $pjq) {
					submitNow($dialog, $grid, $tree, $pjq);
				};


			var bdhtml = '';

			function doPrint() {
				bdhtml = window.document.body.innerHTML;
				var sprnstr = "<!--startprint-->";
				var eprnstr = "<!--endprint-->";
				//				prnhtml = bdhtml.substr(bdhtml.indexOf(sprnstr) + 17);
				var prnhtml = bdhtml.substring(bdhtml.indexOf(sprnstr) + 17, bdhtml.indexOf(eprnstr));
				window.document.body.innerHTML = prnhtml;
				window.print();
				//有问题
				if(tata = document.execCommand("canle")) {
					window.document.body.innerHTML = bdhtml;
				} else {
					window.document.body.innerHTML = bdhtml;
				}
			}

			var rw = ''; // 真实图片宽度
			var rh = ''; //真实图片高度
			$(function() {
				var a = ['tudi', 'zhao', 'shiyi', 'luxian', 'jiankong', 'yanshou', 'xitong', 'jiance', 'tuobu', 'shuoming', 'dengji', 'baogao', 'gangwei', 'tou', 'peixun', 'liuliang', 'wending', 'xiaofang', 'xiangmu', 'cheliang'];
				for(var i = 0; i < a.length; i++) {
					//					alert(a[i]+"img")
					var myimage = document.getElementById(a[i] + "img");
					if(typeof myimage.naturalWidth == "undefined") {　　 // IE 6/7/8
						　　
						var i = new Image();　　
						i.src = myimage.src;　　
						rw = i.width;　　
						rh = i.height;
					} else {　　 // HTML5 browsers
						　　
						rw = myimage.naturalWidth;　　
						rh = myimage.naturalHeight;
					}
					//横图的时候
					if(rw > rh) {
						$('#' + a[i] + 'img').css("width", "100%");
					} else {
						$('#' + a[i] + 'img').parent().css({
							"text-align": "center"
						});
						$('#' + a[i] + 'img').css({
							"height": "100%"
						});
					}
				}
			})
		</script>
